package lt.vu.spf.graph;

import java.io.Serializable;

/**
 * @author Mantas Sinkevičius
 */
public class Vertex implements Serializable {
    private static final long serialVersionUID = 4474473239718421457L;

    private int x;
    private int y;
    private float tentativeDistance;
    private boolean visited;

    public Vertex(int x, int y) {
        this.x = x;
        this.y = y;
    }

    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }

    public float getTentativeDistance() {
        return tentativeDistance;
    }

    public void setTentativeDistance(float tentativeDistance) {
        this.tentativeDistance = tentativeDistance;
    }

    public boolean isVisited() {
        return visited;
    }

    public void setVisited(boolean visited) {
        this.visited = visited;
    }

    @Override
    public boolean equals(Object obj) {
        Vertex v = (Vertex) obj;
        if ((this.x == v.getX()) && (this.y == v.getY())) {
            return true;
        }
        return false;
    }

    @Override
    public String toString() {
        return "(" + x + "," + y + ")";
    }
}
